#! /bin/bash

jar_file=`ps aux ww|grep org.apache.zookeeper.server.quorum.QuorumPeerMain|grep -v grep|awk '{for(i=1;i<=NF;++i){if(index($i,"zookeeper")>1&&index($i,".jar")>1)print $i}}'|awk -F ':' '{for(i=1;i<NF;++i){if(index($i,"lib")>1&&index($i,"build")<1){print $i}}}'|head -1`
if [ -e "$jar_file" ];then
        lib_path=`dirname $jar_file`
        cd $lib_path/../bin/
        echo `pwd`      
fi